import $api from './index';

interface RoleData {
  name?: string;
  path?: string;
  action?: string;
  pid: number | string;
  [key: string]: any;
}

export const getUser = () => $api.get('/users');
// 更新用户信息

export const updateRole = (uid: string | number, roles: RoleData) => $api.patch(`/users/${uid}`, { roles });
// 添加权限
export const addRole = (data: RoleData) => $api.post('/role', data);
// 获取全部的权限信息
export const allRole = () => $api.get('/role');
// 删除权限
export const delRole = (id: string | number) => $api.delete(`/role/${id}`);

export default {};
